<?php
/**
 * 更新收藏夹的名字或者简介
 *
 * 属性：
 *     Favorites_id:用户的收藏夹的id
 *     name:收藏夹的名字
 *     Introduction:收藏夹的简介
 */
session_start();
require_once "./read.php";
$data = json_decode(file_get_contents("php://input"));
$user_id = $_SESSION['id'];
//构建数据
$data = array(
    "user_id"=>$user_id,
    "Favorites_id"=>$data->Favorites_id,
    "name"=>fliter(deal_input($data->name)),
    "Introduction"=>fliter(deal_input($data->Introduction))
);
if($post->Update_Favorites($data)){
    $result = array(
        "status"=>200,
        "msg"=>"收藏夹信息修改成功"
    );
}else{
    $result = array(
        "status"=>201,
        "msg"=>"收藏夹信息修改失败"
    );
}
$res = json_encode($result,JSON_UNESCAPED_UNICODE);
echo $res;
return $res;


